﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Core.Mapping;

namespace WorldEditor.Zones
{
    public partial class WorldZonesChildForm : Form
    {
        public WorldZonesChildForm()
        {
            InitializeComponent();
        }

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            LoadGrid();

        }
        public void LoadGrid()
        {
            //Create visual representation of World and Zones
            WorldZonesGrid wzg = new WorldZonesGrid(TileWorld.CurrentWorld);
            wzg.ZoneClicked += new EventHandler(wzg_ZoneClicked);
            //Add control to tab
            scZones.Panel2.Controls.Add(wzg);
        }

        protected void wzg_ZoneClicked(object sender, EventArgs e)
        {
            TileZone tz = (TileZone)sender;

            propertyGrid1.SelectedObject = tz;
        }
    }
}
